﻿<!DOCTYPE html>
<!--简易吊装作业安全许可证管理-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <style>
             .el-dialog__body{
   
         height:100%!important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
        body {
            padding-bottom: 10px;
        }

        .el-col {
            padding: 10px;
            font-size: 14px;
        }
        td {
            padding: 0 10px;
            font-size: 14px;
        }

        .el-form-item {
            margin-bottom: 0px !important;
        }

        .el-input-group__prepend{
            color: #000;
            font-size: 14px;
        }

        .el-input__inner{
            color: #606266!important
        }

        .el-input-group__prepend {
            padding-left: 0
        }

        .el-input-group__prepend,
        .el-input__inner,
        .el-form-item__label {
            color: #000;
            font-size: 14px;
        }

        .el-form-item__label{
            padding-left: 0!important;
        }

        .el-input-group__prepend {
            padding-left: 0
        }
        .el-form-item__content{
            line-height: 40px!important;
        }
    </style>

</head>
<body>
    
<div id="app" v-cloak>   
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold">盲板抽堵作业安全许可证</label>
        </div>
        <table style="width:100%">
            <tr>
                <td width="40%" style="text-align:right ">{{BlindPlatePumpingSafety.ApplicationTime+mark.m}} {{Form.ApplicationTime}}  </td>
                <td width="60%" style="text-align:right "> {{BlindPlatePumpingSafety.ApplicationNumber+mark.m}} {{Form.ApplicationNumber}}  </td>
            </tr>
        </table>
        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" class="safeCard">
            <!--<el-row type="flex" justify="end">
            <el-col span="23">
                {{BlindPlatePumpingSafety.ApplicationTime+mark.m}} {{Form.ApplicationTime}} &nbsp; &
            nbsp; &nbsp; {{BlindPlatePumpingSafety.ApplicationNumber+mark.m}} {{Form.ApplicationNumber}}
            </el-col>
        </el-row>-->
            <table style="border:1px  solid; width:100%" cellpadding="0" cellspacing="0">
                <!--<tr>
                <td width="50%" style="border-right:1px solid;border-bottom:1px solid  ">
                    {{BlindPlatePumpingSafety.ApplicationUnit}}  {{Form.ApplicationUnit}}
                </td>
                <td width="50%" style="border-bottom:1px solid">

                    {{BlindPlatePumpingSafety.applicant}}  {{Form.applicant}}
                </td>
            </tr>-->
                <tr>
                    <!--作业单位  属地部门 承包商-->
                    <td width="33%" style="border-bottom:1px solid;border-right:1px solid;">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{BlindPlatePumpingSafety.OperatingUnit+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.OperatingUnit" slot="suffix" :placeholder="BlindPlatePumpingSafety.OperatingUnit">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in OperatingUnit" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td width="33%" style="border-right:1px solid; border-bottom:1px solid  ">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{BlindPlatePumpingSafety.TerritorialDepartment+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.TerritorialDepartment" slot="suffix" :placeholder="BlindPlatePumpingSafety.TerritorialDepartment">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in TerritorialDepartment" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td width="34%" style="border-bottom:1px solid  ">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{BlindPlatePumpingSafety.contractor+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.contractor" slot="suffix" :placeholder="HotWorkSafetyLicense.contractor">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in contractor" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="border-bottom:0px solid;border-right:1px solid  " colspan="2">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.JobManagere" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{BlindPlatePumpingSafety.BlindPlatePluggingOperationJSP+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td style="border-bottom:0px solid;padding-left:10px">
                        <el-form-item :label="BlindPlatePumpingSafety.JobType+mark.m">
                            <el-radio-group v-model="Form.JobType" style="margin-top:13px">
                                <el-radio v-for="item in JobType" :label="item.value" :value="item.key">{{item.value}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </td>
                </tr>
                <!--<tr>
                    <td colspan="3" width="100%">
                        <el-form-item :label="BlindPlatePumpingSafety.JobStartTime+mark.m" class="inputTextarea">
                 
                            <el-date-picker v-model="Form.JobStartTime" type="datetime"
                                            placeholder="选择时间">
                            </el-date-picker>
                        </el-form-item>至
                        <el-date-picker v-model="Form.JobEndTime" type="datetime" placeholder="选择时间">
                        </el-date-picker>
                    </td>

                </tr>-->
            </table>
            <!--安全措施-->
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24"  >
                    <el-table :data="Form.HazardIdentification" border >
                        <el-table-column type="index" :label="JobLicenseManagement.SerialNumber"
                                         :index="indexMethod" width="50" show-overflow-tooltip="true"></el-table-column>
                        <el-table-column prop="SafetyMeasures"
                                         :label="BlindPlatePumpingSafety.SafetyMeasures">
                        </el-table-column>

                        <el-table-column :label="BlindPlatePumpingSafety.Department" width="180px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.Department" placeholder="请选择">
                                    <el-option v-for="item in TerritorialDepartment" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="BlindPlatePumpingSafety.Confirmor" width="130px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.Confirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <!--基于数据库管控要求-->
            <!--<el-row style="border:1px  solid;border-top:0px;  ">
                <el-col span="24">
                    <label>{{BlindPlatePumpingSafety.BasedDatabaseManagementRequirements+mark.m}}</label>
                    <a href="javascript:void(0)" v-on:click="RiskInformationBase('tj')">添加</a>
                </el-col>
            </el-row>-->
            <!--<el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.BasedDatabaseManagementRequirements"
                              border
                              >
                        <el-table-column prop="Risk"
                                         :label="EquipmenFacilities.Risk">
                        </el-table-column>
                        <el-table-column prop="ControlRequirement"
                                         :label="BlindPlatePumpingSafety.ControlRequirements">
                        </el-table-column>

                        <el-table-column :label="BlindPlatePumpingSafety.ControlDepartment" width="180px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ControlDepartment" placeholder="请选择">
                                    <el-option v-for="item in TerritorialDepartment" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="BlindPlatePumpingSafety.ControlConfirmor" width="130px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ControlConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>-->
            <el-row style="border:1px  solid; border-top:0px;    ">

                <el-col span="10">
                    <el-form-item :label="BlindPlatePumpingSafety.BlindPlatePositionMap+mark.m" class="redItem">
                        <!--附件名称label-->
                        <label v-model="Form.BlindPlatePositionMap">{{Form.BlindPlatePositionMap}}</label>
                    </el-form-item>
                </el-col>

                <el-col span="14">
                    <el-upload class="upload-demo"
                               ref="Attachmentupload"
                               action="/api/File/UpdateFile"
                               multiple="true"
                               :on-preview="handlePreview"
                               :on-remove="handleRemove"
                               :before-upload="fileAttachmentUploadbeforeupload"
                               :auto-upload="true"
                               :limit="1"
                               :show-file-list="false" >
                        <el-button type="primary" @click="btnAttachmentUpload" style="width:30px;margin-top: 8px;">...</el-button>
                    </el-upload>
                </el-col>
            </el-row>


            <!--审批人-->
            <el-row style="border:1px  solid;border-top:0px;  ">
                <el-col span="24">
                    <label>{{BlindPlatePumpingSafety.Approver+mark.m}}</label><a href="javascript:void(0)" @click="ApproverInput('tj')">添加</a>
                </el-col>
            </el-row>
            <!--审批人数据-->
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.Approver"
                              border
                              >
                        <el-table-column :label="BlindPlatePumpingSafety.ApproverUnit">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ApproverUnit" placeholder="请选择">
                                    <el-option v-for="item in OperatingUnit" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="BlindPlatePumpingSafety.ApproverConfirmor">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ApproverConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.Approver)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>


            <el-row style="border:1px  solid;border-top:0px;  ">
                <el-col span="24">
                    <label>{{HighWorkSafetyPermit.RelatedForm+mark.m}}</label>
                </el-col>
            </el-row>

            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.RelatedForm"
                              border
                              >
                        <el-table-column prop="RelatedFormName" :label="HighWorkSafetyPermit.RelatedFormName">

                        </el-table-column>

                        <el-table-column prop="RelatedFormNo" :label="HighWorkSafetyPermit.RelatedFormNo">

                        </el-table-column>
                        <el-table-column width="53" prop="update" :label="col.btnUpdate" fixed="right">
                            <template slot-scope="scope">
                                <button type="button" class="elst-bt-xg" @click=Bianji('xg',scope.row.id)>
                                    <i class="el-icon-edit"></i>
                                </button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <!--<el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>-->
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog :title="title" :visible.sync="ListItem.dialogVisible" width="90%" height="95%" top="10vh" fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                title:'',
                Form: {
                    id: guidEmpty,
                    ApplicationNumber: "",
                    ApplicationTime: "",
                    applicant: "",
                    OperatingUnit: "",
                    contractor: "",
                    TerritorialDepartment: "",
                    BlindPlatePluggingOperationJSP: "",
                    JobType: "",
                    JobStartTime: "",
                    JobEndTime: "",
                    SafetyMeasures: "",
                    Department: "",
                    Confirmor: "",
                    BasedDatabaseManagementRequirements: "",
                    ControlRequirements: "",
                    ControlDepartment: "",
                    ControlConfirmor: "",
                    Approver: "",
                    ApproverUnit: "",
                    ApproverConfirmor: "",
                    RelatedForm: "",
                    RelatedFormName: "",
                    RelatedFormNo: "",
                    CurrentJob: "",
                    HazardIdentification: '',//安全措施
                    BlindPlatePositionMap:'',
                },
                TerritorialDepartment: [],
                JobType: [],
                contractor: [],
                Confirmor: [],
                OperatingUnit: [],
                rules: {},
                BasedDatabaseManagementRequirements: [],
                ListItem: ListItem,
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                handleSelect: function(ev) {
                    console.log(ev);
                },
                handleChecked: function (value) {
                },
                handleCheckedConfirmation: function (value) {
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getDataAdd(this, '/api/BlindPlatePumpingSafety/get?id=' + this.id);
                },

                ApproverInput: function (val, id) {
                    this.title = "审批人管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/ApproverInput.html", id);
                },
                Bianji: function (val, id) {
                    this.title = "相关表格管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/RelatedTableList.html", id);
                },     
                RiskInformationBase: function (val, id) {
                    this.title = "基于数据库管控要求管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/RiskInformationBase.html", id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    //this.$refs[formName].validate(function (valid) {
                    //    //验证通过
                    //    if (valid) {
                    onSubmitForm(this, '/api/BlindPlatePumpingSafety/Save', mythis.Form);
                    //} else {
                    //    //验证失败
                    //    return false;
                    //}
                    //});
                },
                submitFileListUpload: function () {
                    //若更换文件则将文件名字更换触发条件--先删除上一个文件,后添加一个文件
                    if (this.labelUpload != uploadText) {
                        this.$refs.Fileupload.clearFiles();
                        this.labelUpload = file.name;
                    }
                    else {

                    }
                    //this.$refs.upload.submit();
                },
                handleRemove: function (file) {
                    console.log(file);
                },
                handlePreview: function (file) {
                    console.log(file.name);
                    window.open(file.url)
                },
                //上传前文件的校验
                beforeupload: function (file) {
                    var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
                    //将文件名称赋值到label上
                    this.labelUpload = file.name;
                    const extension = testmsg === 'xls'
                    const extension2 = testmsg === 'xlsx'
                    const isLt2M = file.size / 1024 / 1024 < 10

                    if (!extension && !extension2) {
                        this.$message({
                            message: '上传文件只能是 xls、xlsx格式!',
                            type: 'warning'
                        });
                    }
                    if (!isLt2M) {
                        this.$message({
                            message: '上传文件大小不能超过 10MB!',
                            type: 'warning'
                        });
                    }
                    if (extension || extension2 && isLt2M)
                        submitUpload(this, 'upload')
                    return extension || extension2 && isLt2M
                },
                //上传附件文件的校验
                fileAttachmentUploadbeforeupload: function (file) {
                    var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
                    //将附件名赋值到label上
                    this.Form.Annex = file.name;
                    const extension = testmsg === 'rar'
                    const extension2 = testmsg === 'zip'
                    const isLt2M = file.size / 1024 / 1024 < 10
                    if (!extension && !extension2) {
                        this.$message({
                            message: '上传文件只能是 rar、zip格式!',
                            type: 'warning'
                        });
                    }
                    if (!isLt2M) {
                        this.$message({
                            message: '上传文件大小不能超过 10MB!',
                            type: 'warning'
                        });
                    }
                    if (extension || extension2 && isLt2M)
                        submitUpload(this, 'upload')
                    return extension || extension2 && isLt2M
                }, btnAttachmentUpload: function () {
                    //若更换文件则将文件名字更换触发条件--先删除上一个文件,后添加一个文件
                    if (this.fileAttachmentUpload != uploadText) {
                        this.$refs.Attachmentupload.clearFiles();
                        this.fileAttachmentUpload = file.name;
                    }
                    else {

                    }
                    this.$refs.Attachmentupload.submit();
                }  
            },
            mounted: function () {
                var list = getDicDataArray(['14', '132', '12', '09', '08']);
                this.OperatingUnit = getDicDatafromArray('08', list);//作业单位
                this.TerritorialDepartment = getDicDatafromArray('14', list);//属地部门
                this.JobType = getDicDatafromArray('132', list);//工作类型
                this.contractor = getDicDatafromArray('12', list);//承包商
                this.Confirmor = getDicDatafromArray("09", list);//批准人
                this.id = getUrlParam("id");
                this.getData();
                //this.BasedDatabaseManagementRequirements = this.Form.BasedDatabaseManagementRequirements;
            }
        });
    </script>
</body>
</html>